package food;


import java.util.Scanner;

public class Food implements IFood{
   //默认各种食物各自100kg
   private static int meatfood=100;
   private static int tigerfood=100;
    private static int dolphinfood=100;
    private static int peaccockfood=100;

    @Override
    public int getFood() {//
        System.out.println("请输入你要投喂食物的数量（kg）：");
        Scanner scanner=new Scanner(System.in);
        int amount=scanner.nextInt();
        return amount;
    }
    @Override
    public void addFood() {//
        System.out.println("请输入你要购买的食物数量（kg）：");
        Scanner scanner=new Scanner(System.in);
        int amount=scanner.nextInt();
        meatfood+=amount;
        tigerfood+=amount;
        dolphinfood+=amount;
        peaccockfood+=amount;
        System.out.println("现在肉类有(单位kg)："+getMeatfood()+" 虎粮有："+getTigerfood()+" 海豚粮食有："+getDolphinfood()+" 孔雀粮食有："+getPeaccockfood());
    }
    //各种食物的设置和返回访问器,*********
    public int getMeatfood() {
        return meatfood;
    }

    public void setMeatfood(int meatfood) {
        this.meatfood = 100-meatfood;//set访问器依靠100减去传入的参数数量来记录剩余数量
    }
    public int getTigerfood() {
        return tigerfood;
    }
    public void setTigerfood(int tigerfood) {
        this.tigerfood = 100-tigerfood;//set访问器依靠100减去传入的参数数量来记录剩余数量
    }
    public int getDolphinfood() {
        return dolphinfood;
    }
    public void setDolphinfood(int dolphinfood) {
        this.dolphinfood = 100-dolphinfood;//set访问器依靠100减去传入的参数数量来记录剩余数量
    }
    public int getPeaccockfood() {
        return peaccockfood;
    }
    public void setPeaccockfood(int peaccockfood) {
        this.peaccockfood = 100-peaccockfood;//set访问器依靠100减去传入的参数数量来记录剩余数量
    }
}
